-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
308: Add skeleton loading component #378
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,112 @@ | |||
export type NativeTags = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is based on Marko.NativeTags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React has keyof React.JSX.IntrinsicElements
, we should use that instead. But I think skin supports div
and span
only as per documentation
@@ -0,0 +1,21 @@ | |||
import React, { ComponentProps, FC } from 'react' |
Check warning
Code scanning / ESLint
Disallow unused variables Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 24 days ago
To fix the problem, we need to remove the unused import ComponentProps
from the import statement on line 1. This will resolve the ESLint error and clean up the code by removing unnecessary imports.
-
Copy modified line R1
@@ -1,2 +1,2 @@ | ||
import React, { ComponentProps, FC } from 'react' | ||
import React, { FC } from 'react' | ||
import classNames from 'classnames' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like valid concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint should have got this, we need to understand why not
import React, { ComponentProps, FC } from 'react' | ||
import classNames from 'classnames' | ||
|
||
export type Props = ComponentProps<'div'> & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[trivial] other components are exporting types in a separate file
|
||
export type Props = ComponentProps<'div'> | ||
|
||
const EbaySkeletonText: FC<Props> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be EbaySkeletonTextbox?
@@ -0,0 +1,21 @@ | |||
import React, { ComponentProps, FC } from 'react' | |||
import classNames from 'classnames' | |||
import { NativeTags } from './nativeTags' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the react type instead:
as?: keyof React.JSX.IntrinsicElements;
But I think skin supports div
and span
only
className, | ||
...rest | ||
}) => ( | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to support the as
also
className, | ||
...rest | ||
}) => ( | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to support as
also
multiline, | ||
...rest | ||
}) => ( | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to support as
also
className, | ||
...rest | ||
}) => ( | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to support as
also
@@ -0,0 +1,112 @@ | |||
export type NativeTags = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React has keyof React.JSX.IntrinsicElements
, we should use that instead. But I think skin supports div
and span
only as per documentation
Need to do more work with storybook and see what tests to add, but the code is here and mimics what was done in the Marko versions.